package com.group3.group3.baobiao.gdpinfo.service.impl;

import com.group3.group3.baobiao.gdpinfo.entity.GdpinfoSearchEnity;
import com.group3.group3.baobiao.gdpinfo.repository.GdpinfoDao;
import com.group3.group3.baobiao.gdpinfo.service.GdpinfoService;
import com.group3.group3.mybatis.entity.GdpEntity;
import com.group3.group3.mybatis.flexigrid.PadingRstType;
import com.group3.group3.mybatis.flexigrid.PagingBean;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;

/**
 * @author Hhw-byte
 * @create 2022-05-16 11:10
 */
@Service("gdpService")
class GdpinfoServiceImpl implements GdpinfoService {

    @Resource//将UserDao注入进来，就可以通过userDao访问UserDao接口中的方法
    private GdpinfoDao gdpDao;
    @Override
    public PadingRstType<GdpEntity> getGdpinfoListByPage(GdpinfoSearchEnity search, PagingBean paging) {
        paging.deal(GdpEntity.class);
        PadingRstType<GdpEntity> padingRstType = new PadingRstType<>();
        padingRstType.setPage(paging.getPage());
        List<GdpEntity> list = gdpDao.queryGdpListByPage(search,paging);
        Integer total =gdpDao.queryGdpListTotal(search);
        padingRstType.setRawRecords(list);
        padingRstType.setTotal(total);
        padingRstType.putItems();
        return padingRstType;
    }
}
